﻿using System;
using System.Data;
using System.Collections;
using System.Web;
using System.Web.UI.WebControls;

namespace WebSys.UI
{
    public partial class ZSPG_PGALDetail : System.Web.UI.Page
    {
        EluZSProvider.EluZSDataProvider _EluZSDataProvider = (EluZSProvider.EluZSDataProvider)Antu.Core.Services.ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");
        protected global::System.Web.UI.HtmlControls.HtmlForm form1;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }
        protected void BindData()
        {
            string strSql = string.Format(@"select t.*,round(TRADE_PRICE,2) TRADEPRICE,round(TRADE_TOTAL,2) TRADETOTAL,
                round(TAX_PRICE,2) TAXPRICE,round(TAX_TOTAL,2) TAXTOTAL 
                from CQ_CAM_CASE t where id='{0}'", Request["id"]);
            DataTable dtTemp = _EluZSDataProvider.GetTableNeto2(strSql);
            if (dtTemp.Rows.Count > 0)
            {
                foreach (System.Web.UI.Control col in form1.Controls)
                {
                    string colName = "";
                    if (col != null)
                    {
                        if (col.ID != null)
                        {
                            colName = col.ID.Substring(3, col.ID.Length - 3);
                        }
                    }
                    foreach (DataColumn column in dtTemp.Columns)
                    {
                        if (column.ColumnName.ToUpper() == colName.ToUpper())
                        {
                            if (col is Label)
                            {
                                Label objCon = col as Label;
                                objCon.Text = dtTemp.Rows[0][column].ToString();
                            }
                        }
                    }
                }
            }
        }
    }
}